package com.maoxx.humanresourcemanage_service.dto;

import com.maoxx.humanresourcemanage_service.enums.BaseEnum;
import com.maoxx.humanresourcemanage_service.enums.BusinessStatusEnum;

/**
 * @className: Response
 * @author: Maoxx
 * @date: 2024/11/6 18:41
 * @Version: 1.0
 * @description:
 */

public class Response {
    public static ResponseDTO success(){
        return new ResponseDTO(BusinessStatusEnum.SUCCESS);
    }

    public static ResponseDTO success(String message){
        return new ResponseDTO(BusinessStatusEnum.SUCCESS.getCode(), message);
    }

    public static ResponseDTO success(Object data){
        return new ResponseDTO(BusinessStatusEnum.SUCCESS,data);
    }

    public static ResponseDTO success(Object data,String token){
        return new ResponseDTO(BusinessStatusEnum.SUCCESS,data,token);
    }

    public static ResponseDTO success(String message, Object data){
        return new ResponseDTO(BusinessStatusEnum.SUCCESS.getCode(),message,data);
    }

    public static ResponseDTO error(String message){
        return new ResponseDTO(BusinessStatusEnum.ERROR.getCode(), message);
    }

    public static ResponseDTO error(){
        return new ResponseDTO(BusinessStatusEnum.ERROR);
    }

    public static ResponseDTO error(Integer code, String message){
        return new ResponseDTO(code,message);
    }

    public static ResponseDTO error(BaseEnum e) {
        return new ResponseDTO(e);
    }
}
